import React, { useState, useEffect } from "react";
import "./index.less";

function Switches({ value, onChange }) {
  return (
    <label className="switch">
      <input
        type="checkbox"
        className="checkbox"
        checked={value == "light"}
        onChange={() => {
          onChange(value == "light" ? "dark" : "light");
        }}
      />
      <span className="slider"></span>
    </label>
  );
}

export default Switches;
